<?php namespace App\Client\Goods\Listeners;

use Auth;
use App\Core\Exceptions\InputError;
use App\Core\Service\Listeners\CreateListener as Base;

class CreateListener extends Base {
    
    public function onCreateGeneratedData(){
        $user = Auth::user();
        $supplier = $user->supplier;
        if(!$supplier){
            throw new InputError('非法操作');
        }
        $this->service->createData['supplier_id'] = $supplier->id;
    }
}